import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { MyWaitdealComponent } from './my-waitdeal.component';
import { SystemApprovalComponent } from './system-approval/system-approval.component';
import { RouterModule, Routes } from '@angular/router';
import { LoginActivate } from '../../core/auth/login.activate';
import { NgZorroAntdModule } from 'ng-zorro-antd';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { ShareModule } from '../../share/share.module';
import { FeedbackApprovalComponent } from './feedback-approval/feedback-approval.component';
import { ApprovalFormComponent } from './approval-form/approval-form.component';
import { PdfJsViewerModule } from 'ng2-pdfjs-viewer';

const routes: Routes = [
  {
    path: '', component: MyWaitdealComponent, children: [
      {
        path: 'system-approval',
        component: SystemApprovalComponent,
        data: {
          breadcrumb: '制度审批'
        },
        canActivate: [LoginActivate]
      },
      {
        path: 'feedback-approval',
        component: FeedbackApprovalComponent,
        data: {
          breadcrumb: '反馈审批'
        },
        canActivate: [LoginActivate]
      },
      {
        path: '', redirectTo: 'system-approval', pathMatch: 'full'
      },
      {
        path: '**', component: SystemApprovalComponent
      }
    ]
  }
]

@NgModule({
  declarations: [
    MyWaitdealComponent,
    SystemApprovalComponent,
    FeedbackApprovalComponent,
    ApprovalFormComponent
  ],
  imports: [
    CommonModule,
    NgZorroAntdModule,
    FormsModule,
    ReactiveFormsModule,
    ShareModule,
    RouterModule.forChild(routes),
    PdfJsViewerModule
  ]
})
export class MyWaitdealModule { }
